'use strict';

const mongoose = require('mongoose'),
    clientModel = mongoose.model('Client');

module.exports = {
    clientRegister: clientRegister,
    getClientByLogin: getClientByLogin,
}

function clientRegister(client,callback){    
    clientModel.create(client,function(error,data){
        callback(null,data);
    });
}

function getClientByLogin(client,callback){
     clientModel.find({
         cname: client.cname,
         cpwd: client.cpwd,       
     },function(error, data){
         callback(null,data);
     });

}